<?php

namespace app\api\home;

use app\api\model\User;

class UserController extends Base
{
    /**
     * Notes:获取用户信息
     * User: tangfen
     * Date: 2024/1/3
     * Time: 19:03
     */
    public function getUserInfo()
    {
        $res = (new User)->details($this->uid);
        if ($res) {
            return_ajax(1, '获取成功', $res);
        } else {
            return_ajax(0, 'b不存在该用户');
        }
    }

    /**
     * Notes:编辑用户信息
     * User: tangfen
     * Date: 2024/1/3
     * Time: 19:16
     */
    public function editUser()
    {
        $params = $this->request->param();

        $res =  (new User)->editUser($this->uid,$params);

        if ($res) {
            return_ajax(1, '操作成功', $res);
        } else {
            return_ajax(0, '操作失败');
        }

    }


}